<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>2.- Single Thread Algorithms</title>
<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../index.html" title="Boost.Sort">
<link rel="up" href="../index.html" title="Boost.Sort">
<link rel="prev" href="../index.html" title="Boost.Sort">
<link rel="next" href="single_thread/spreadsort.html" title="2.1.-Spreadsort">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
<td align="center"><a href="../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../index.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="single_thread/spreadsort.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="sort.single_thread"></a><a class="link" href="single_thread.html" title="2.- Single Thread Algorithms">2.- Single Thread Algorithms</a>
</h2></div></div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="single_thread.html#sort.single_thread.overview">2.0.- Overview</a></span></dt>
<dt><span class="section"><a href="single_thread/spreadsort.html">2.1.-Spreadsort</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="single_thread/spreadsort.html#sort.single_thread.spreadsort.overview">Overview</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="single_thread/spreadsort.html#sort.single_thread.spreadsort.overview.intro">Introduction</a></span></dt>
<dt><span class="section"><a href="single_thread/spreadsort.html#sort.single_thread.spreadsort.overview.overloading">Overloading</a></span></dt>
<dt><span class="section"><a href="single_thread/spreadsort.html#sort.single_thread.spreadsort.overview.performance">Performance</a></span></dt>
<dt><span class="section"><a href="single_thread/spreadsort.html#sort.single_thread.spreadsort.overview.tuning">Tuning</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="single_thread/spreadsort/sort_hpp.html">Spreadsort</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="single_thread/spreadsort/sort_hpp.html#sort.single_thread.spreadsort.sort_hpp.header_spreadsort">Header
          <code class="computeroutput">&lt;boost/sort/spreadsort/spreadsort.hpp&gt;</code></a></span></dt>
<dd><dl><dt><span class="section"><a href="single_thread/spreadsort/sort_hpp.html#sort.single_thread.spreadsort.sort_hpp.header_spreadsort.spreadsort_examples">Spreadsort
            Examples</a></span></dt></dl></dd>
<dt><span class="section"><a href="single_thread/spreadsort/sort_hpp/integer_sort.html">Integer
          Sort</a></span></dt>
<dd><dl><dt><span class="section"><a href="single_thread/spreadsort/sort_hpp/integer_sort.html#sort.single_thread.spreadsort.sort_hpp.integer_sort.integersort_examples">Integer
            Sort Examples</a></span></dt></dl></dd>
<dt><span class="section"><a href="single_thread/spreadsort/sort_hpp/float_sort.html">Float
          Sort</a></span></dt>
<dd><dl><dt><span class="section"><a href="single_thread/spreadsort/sort_hpp/float_sort.html#sort.single_thread.spreadsort.sort_hpp.float_sort.floatsort_examples">Float
            Sort Examples</a></span></dt></dl></dd>
<dt><span class="section"><a href="single_thread/spreadsort/sort_hpp/string_sort.html">String
          Sort</a></span></dt>
<dd><dl><dt><span class="section"><a href="single_thread/spreadsort/sort_hpp/string_sort.html#sort.single_thread.spreadsort.sort_hpp.string_sort.stringsort_examples">String
            Sort Examples</a></span></dt></dl></dd>
<dt><span class="section"><a href="single_thread/spreadsort/sort_hpp/rationale.html">Rationale</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="single_thread/spreadsort/sort_hpp/rationale.html#sort.single_thread.spreadsort.sort_hpp.rationale.radix_sorting">Radix
            Sorting</a></span></dt>
<dt><span class="section"><a href="single_thread/spreadsort/sort_hpp/rationale/hybrid_radix.html">Hybrid
            Radix</a></span></dt>
<dt><span class="section"><a href="single_thread/spreadsort/sort_hpp/rationale/why_spreadsort.html">Why
            spreadsort?</a></span></dt>
<dt><span class="section"><a href="single_thread/spreadsort/sort_hpp/rationale/unstable_sort.html">Unstable
            Sorting</a></span></dt>
<dt><span class="section"><a href="single_thread/spreadsort/sort_hpp/rationale/optimization.html">Unused
            X86 optimization</a></span></dt>
<dt><span class="section"><a href="single_thread/spreadsort/sort_hpp/rationale/lookup.html">Lookup
            Table?</a></span></dt>
</dl></dd>
</dl></dd>
<dt><span class="section"><a href="single_thread/spreadsort/definitions.html">Definitions</a></span></dt>
<dt><span class="section"><a href="single_thread/spreadsort/faq.html">Frequently Asked
        Questions</a></span></dt>
<dt><span class="section"><a href="single_thread/spreadsort/acks.html">Acknowledgements</a></span></dt>
<dt><span class="section"><a href="single_thread/spreadsort/bibliog.html">Bibliography</a></span></dt>
<dt><span class="section"><a href="single_thread/spreadsort/history.html">History</a></span></dt>
<dt><span class="section"><a href="../boost_sort_c___reference.html">Boost.Sort C++ Reference</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="../boost_sort_c___reference.html#header.boost.sort.spreadsort.float_sort_hpp">Header &lt;boost/sort/spreadsort/float_sort.hpp&gt;</a></span></dt>
<dd><dl></dl></dd>
<dt><span class="section"><a href="../header/boost/sort/spreadsort/integer_sort_hpp.html">Header &lt;boost/sort/spreadsort/integer_sort.hpp&gt;</a></span></dt>
<dd><dl></dl></dd>
<dt><span class="section"><a href="../header/boost/sort/spreadsort/spreadsort_hpp.html">Header &lt;boost/sort/spreadsort/spreadsort.hpp&gt;</a></span></dt>
<dd><dl></dl></dd>
<dt><span class="section"><a href="../header/boost/sort/spreadsort/string_sort_hpp.html">Header &lt;boost/sort/spreadsort/string_sort.hpp&gt;</a></span></dt>
<dd><dl></dl></dd>
</dl></dd>
</dl></dd>
<dt><span class="section"><a href="single_thread/pdqsort.html">2.2.- pdqsort</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="single_thread/pdqsort.html#sort.single_thread.pdqsort.pdqsort_intro">Introduction</a></span></dt>
<dt><span class="section"><a href="single_thread/pdqsort/pdqsort_usage.html">Usage</a></span></dt>
<dt><span class="section"><a href="single_thread/pdqsort/pdqsort_benchmark.html">Benchmark</a></span></dt>
<dt><span class="section"><a href="single_thread/pdqsort/pdqsort_best.html">The Best Case</a></span></dt>
<dt><span class="section"><a href="single_thread/pdqsort/pdqsort_avg.html">The Average
        Case</a></span></dt>
<dt><span class="section"><a href="single_thread/pdqsort/pdqsort_worst.html">The Worst
        Case</a></span></dt>
<dt><span class="section"><a href="single_thread/pdqsort/pdqsort_bad_partitions.html">Bad
        Partitions</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="single_thread/spinsort.html">2.3.- spinsort</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="single_thread/spinsort.html#sort.single_thread.spinsort.spinsort_description">Description</a></span></dt>
<dt><span class="section"><a href="single_thread/spinsort/spinsort_benchmark.html">Benchmark</a></span></dt>
<dt><span class="section"><a href="single_thread/spinsort/spinsort_programming.html">Programming</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="single_thread/flat_stable_sort.html">2.4.- flat_stable_sort</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="single_thread/flat_stable_sort.html#sort.single_thread.flat_stable_sort.flat_stable_sort_description">Description</a></span></dt>
<dt><span class="section"><a href="single_thread/flat_stable_sort/flat_stable_sort_benchmark.html">Benchmark</a></span></dt>
<dt><span class="section"><a href="single_thread/flat_stable_sort/flat_stable_sort_programming.html">Programming</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="single_thread/linux_single.html">2.5.- Linux Benchmarks</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="single_thread/linux_single.html#sort.single_thread.linux_single.near_sorted">Near Sorted
        Data</a></span></dt>
<dt><span class="section"><a href="single_thread/linux_single/complex_benchmarks.html">Complex
        (Several Types)</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="single_thread/windows_single.html">2.6.- Windows Benchmarks</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="single_thread/windows_single.html#sort.single_thread.windows_single.near_sorted">Near
        Sorted Data</a></span></dt>
<dt><span class="section"><a href="single_thread/windows_single/complex_benchmarks.html">Complex
        (Several Types)</a></span></dt>
</dl></dd>
</dl></div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="sort.single_thread.overview"></a><a class="link" href="single_thread.html#sort.single_thread.overview" title="2.0.- Overview">2.0.- Overview</a>
</h3></div></div></div>
<div class="blockquote"><blockquote class="blockquote">
<h5>
<a name="sort.single_thread.overview.h0"></a>
          <span class="phrase"><a name="sort.single_thread.overview.single_thread_algorithms"></a></span><a class="link" href="single_thread.html#sort.single_thread.overview.single_thread_algorithms"><span class="underline">Single Thread Algorithms</span></a>
        </h5>
<div class="blockquote"><blockquote class="blockquote">
<p>
            This table provides a brief description of the single thread algorithms
            of the library.
          </p>
<p>
            <span class="bold"><strong>
<pre class="programlisting">                  |       |                            |                                         | Comparison          |
Algorithm         |Stable |   Additional memory        |  Best, average, and worst case          | method              |
------------------+-------+----------------------------+-----------------------------------------+---------------------+
spreadsort        |  no   |      key_length            | N, Nsqrt(LogN), min(NlogN, Nkey_length) | Hybrid radix sort   |
pdqsort           |  no   |      Log N                 | N, NLogN, NLogN                         | Comparison operator |
spinsort          |  yes  |      N / 2                 | N, NLogN, NLogN                         | Comparison operator |
flat_stable_sort  |  yes  |size of the data / 256 + 8K | N, NLogN, NLogN                         | Comparison operator |
                  |       |                            |                                         |                     |
</pre>
            </strong></span>
          </p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
                <span class="bold"><strong>spreadsort</strong></span> is an extremely fast
                hybrid radix sort algorithm, designed and developed by Steven Ross.
              </li>
<li class="listitem">
                <span class="bold"><strong>pdqsort</strong></span> is a improvement of the
                quick sort algorithm, designed and developed by Orson Peters.
              </li>
<li class="listitem">
                <span class="bold"><strong>spinsort</strong></span> is a stable sort that is
                fast with random or nearly sorted data, designed and developed by
                Francisco Tapia.
              </li>
<li class="listitem">
                <span class="bold"><strong>flat_stable_sort</strong></span> is a stable sort
                that uses very little additional memory (around 1% of the size of
                the data), providing 80% - 90% of the speed of spinsort, designed
                and developed by Francisco Tapia.
              </li>
</ul></div>
</blockquote></div>
</blockquote></div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2014-2017 Steven
      Ross, Francisco Tapia, Orson Peters<p>
        Distributed under the <a href="http://boost.org/LICENSE_1_0.txt" target="_top">Boost
        Software License, Version 1.0</a>.
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../index.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="single_thread/spreadsort.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
